package app.server.project.main.service.bo.event;

import app.server.project.main.service.db.entity.cfg.RechargeCfgEntity;
import app.server.project.main.service.db.entity.user.RechargeOrderEntity;
import cn.hutool.core.bean.BeanUtil;
import lombok.Data;

@Data
public class RechargeSuccessEvent {
    private long userId;

    private long param;


    private int callbackType;

    private RechargeOrderEntity order;

    private long createTime;

    public static RechargeSuccessEvent create(long userId, RechargeCfgEntity rechargeCfgEntity, RechargeOrderEntity order) {
        RechargeSuccessEvent event = new RechargeSuccessEvent();
        event.setUserId(userId);
        BeanUtil.copyProperties(rechargeCfgEntity, event);
        event.setOrder(order);
        return event;
    }

    public static RechargeSuccessEvent createTon(long userId, RechargeCfgEntity rechargeCfgEntity, RechargeOrderEntity order, long createTime) {
        RechargeSuccessEvent event = new RechargeSuccessEvent();
        event.setUserId(userId);
        BeanUtil.copyProperties(rechargeCfgEntity, event);
        event.setOrder(order);
        event.setCreateTime(createTime);
        return event;
    }
}
